package com.gxan.utils;

import java.util.UUID;

/**
 * @ author yutang
 * @ date 2024/1/2 0002 10:23
 * @ version 1.0
 * @ desc
 */
public class FileUtils {
    public static String newFileName(String prefix,String fileName) {
        int dotLastIndex = fileName.lastIndexOf(".");
        if (dotLastIndex == -1){
            return null;
        }
        String suffix = fileName.substring(dotLastIndex);
        return prefix + "_" + UUID.randomUUID().toString().replace("-","") + "_" + System.currentTimeMillis() + suffix;
    }

}
